#-----------------------------------------------------------------------------
# Name:        mainFrame.py
# Purpose:     
#
# Author:      <your name>
#
# Created:     2010/11/25
# RCS-ID:      $Id: mainFrame.py $
# Copyright:   (c) 2006
# Licence:     <your licence>
#-----------------------------------------------------------------------------
#Boa:Frame:menuCaixaFrame

import wx
from cadFornFrame import *
from cadFuncFrame import *
from cadProdFrame import *
from pedEntradaFrame import *
from pedSaidaFrame import *

#criando lista para armazenar os produtos
listaProdutos = []

def create(parent):
    return menuCaixaFrame(parent)

[wxID_MENUCAIXAFRAME, wxID_MENUCAIXAFRAMESTATUSBAR1, 
] = [wx.NewId() for _init_ctrls in range(2)]

[wxID_MAINFRAMECADASTROMENUFORNECEDORES, 
 wxID_MAINFRAMECADASTROMENUFUNCIONARIOS, wxID_MAINFRAMECADASTROMENUPRODUTOS, 
] = [wx.NewId() for _init_coll_cadastroMenu_Items in range(3)]

[wxID_MAINFRAMERELATORIOSMENUCADPESS, wxID_MAINFRAMERELATORIOSMENUCADPROD, 
 wxID_MAINFRAMERELATORIOSMENUCAPAG, wxID_MAINFRAMERELATORIOSMENUCAREC, 
 wxID_MAINFRAMERELATORIOSMENUCOMPRAS, wxID_MAINFRAMERELATORIOSMENUVENDAS, 
] = [wx.NewId() for _init_coll_relatoriosMenu_Items in range(6)]

[wxID_MAINFRAMERELATORIOMENUCONTAPAGAR, 
 wxID_MAINFRAMERELATORIOMENUCONTARECEBER, 
] = [wx.NewId() for _init_coll_relatorioMenu_Items in range(2)]

[wxID_MAINFRAMEPARAMETROSMENUDEFINIR] = [wx.NewId() for _init_coll_parametrosMenu_Items in range(1)]

[wxID_MENUCAIXAFRAMESAIRMENUSAIR] = [wx.NewId() for _init_coll_sairMenu_Items in range(1)]

[wxID_MENUCAIXAFRAMEMOVIMENTOMENUVENDAS] = [wx.NewId() for _init_coll_movimentoMenu_Items in range(1)]

class menuCaixaFrame(wx.Frame):
    def _init_coll_movimentoMenu_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='', id=wxID_MENUCAIXAFRAMEMOVIMENTOMENUVENDAS,
              kind=wx.ITEM_NORMAL, text=u'Vendas')
        self.Bind(wx.EVT_MENU, self.OnMovimentoMenuVendasMenu,
              id=wxID_MENUCAIXAFRAMEMOVIMENTOMENUVENDAS)

    def _init_coll_menuBarCaixa_Menus(self, parent):
        # generated method, don't edit

        parent.Append(menu=self.movimentoMenu, title=u'Movimento')
        parent.Append(menu=self.sairMenu, title=u'Sair')

    def _init_coll_sairMenu_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='', id=wxID_MENUCAIXAFRAMESAIRMENUSAIR,
              kind=wx.ITEM_NORMAL, text=u'Sair')
        self.Bind(wx.EVT_MENU, self.OnSairMenuSairMenu,
              id=wxID_MENUCAIXAFRAMESAIRMENUSAIR)

    def _init_coll_statusBar1_Fields(self, parent):
        # generated method, don't edit
        parent.SetFieldsCount(1)

        parent.SetStatusText(number=0, text=u'Status')

        parent.SetStatusWidths([-1])

    def _init_utils(self):
        # generated method, don't edit
        self.movimentoMenu = wx.Menu(title=u'')

        self.sairMenu = wx.Menu(title=u'')

        self.menuBarCaixa = wx.MenuBar()

        self._init_coll_movimentoMenu_Items(self.movimentoMenu)
        self._init_coll_sairMenu_Items(self.sairMenu)
        self._init_coll_menuBarCaixa_Menus(self.menuBarCaixa)

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_MENUCAIXAFRAME, name=u'menuCaixaFrame',
              parent=prnt, pos=wx.Point(202, 40), size=wx.Size(816, 681),
              style=wx.MAXIMIZE | wx.DEFAULT_FRAME_STYLE,
              title=u'suPymercado - TELA DE VENDA')
        self._init_utils()
        self.SetClientSize(wx.Size(800, 643))
        self.SetHelpText(u'')
        self.SetMenuBar(self.menuBarCaixa)

        self.statusBar1 = wx.StatusBar(id=wxID_MENUCAIXAFRAMESTATUSBAR1,
              name='statusBar1', parent=self, style=0)
        self._init_coll_statusBar1_Fields(self.statusBar1)
        self.SetStatusBar(self.statusBar1)

    def __init__(self, parent, usuario):
        self._init_ctrls(parent)
        self.usuario = usuario


    def OnMovimentoMenuVendasMenu(self, event):
        menu = pedVendaFrame(None, self.usuario)
        menu.Show()
        print self.usuario


    def OnSairMenuSairMenu(self, event):
        self.Close()
